package com.polysichong.netschool.action.admin;

import com.polysichong.framework.action.BaseAction;
import com.polysichong.netschool.entity.admin.User;
import com.polysichong.netschool.service.admin.UserService;

public class UserAddAction extends BaseAction {
	
	private static final long serialVersionUID = 3129180317813363754L;
	
	private UserService userService;
	
	private User user = null;
	
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String doInit() throws Exception{
		return SUCCESS;
	}

	public String doSave() throws Exception{
		
		userService.save(user);
		
		return LIST;
	}
}
